package com.lening.iot.web;

import cn.hutool.extra.spring.SpringUtil;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Mono;

/**
 * @ToDo:
 * @Author：李忠达
 * @date: 2024/6/17 10:00
 */
public class Request {
    public static <T> Mono<T> get(String uri, Class<T> clazz) {
        WebClient webClient = SpringUtil.getBean(WebClient.class);
        return webClient.get().uri("http://" + uri).retrieve().bodyToMono(clazz);
    }
}
